home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4810 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: news.clark.net!not-for-mail
  2. From: gusty@clark.net (Harlan Messinger)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: READ THIS!!!!!!!!!!!
  5. Date: 31 Jan 1996 20:18:41 GMT
  6. Organization: Clark Internet Services, Inc., Ellicott City, MD USA
  7. Message-ID: <4eoir1$726@clarknet.clark.net>
  8. References: <4em5fs$a86@ixnews4.ix.netcom.com>
  9. NNTP-Posting-Host: explorer.clark.net
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=ISO-8859-1
  12. Content-Transfer-Encoding: 8bit
  13. X-Newsreader: TIN [UNIX 1.3 950726BETA PL0]
  14.  
  15. Jeremy Johnston (jeremyx@ix.netcom.com) wrote:
  16. :   ok....now that I have your attention i need some help.
  17. : I can't get the following command to work & the compiler says that the
  18. : constant has too many characters.
  19. :   char dos;
  20. :     if(dos=='dir')
  21. :     goto b;
  22.  
  23. Either you haven't learned how strings work in C/C++ or you badly need a 
  24. refresher.
  25.  
  26. Single quotes delimit characters; double quotes delimit strings. 'dir' is 
  27. invalid. "dir" is OK, but you won't get far comparing it to the variable 
  28. dos because you'll be comparing the value of dos with the address of the 
  29. constant string "dir".
  30.  
  31. And heaven help you if your teacher/professor ever catches a goto in your 
  32. C++ code.
  33.